package com.kakarote.hrm.constant;

public enum HrmDeptTypeEnum {
    /**
     * 操作记录类型类型枚举
     */
    COMPANY(1, "公司"),
    DEPARTMENT(2, "部门"),
    ;

    HrmDeptTypeEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }


    private String name;
    private int value;

    public static String parseName(int type) {
        for (HrmDeptTypeEnum value : HrmDeptTypeEnum.values()) {
            if (value.value == type) {
                return value.name;
            }
        }
        return "";
    }

    public static int valueOfType(String name) {
        for (HrmDeptTypeEnum value : HrmDeptTypeEnum.values()) {
            if (value.name.equals(name)) {
                return value.value;
            }
        }
        return -1;
    }

    public String getName() {
        return name;
    }

    public int getValue() {
        return value;
    }
}
